using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Collections;
using System.Collections.Specialized;
using UMC.Data;

namespace UMC.Web
{
    /// <summary>
    /// 文字识别对话框
    /// </summary>
    public class UIOcrDialog : UIDialog
    {
        /// <summary>
        /// 卡证识别
        /// </summary>
        /// <param name="type">卡证类型</param>
        public UIOcrDialog(int type)
        {

            this.Config.Put("OcrType", type);// new WebMeta().Put("Name", name, "NO", no)); 
        }
        /// <summary>
        /// 对话框类型
        /// </summary>
        protected override string DialogType
        {
            get { return "Ocr"; }
        }
        /// <summary>
        /// 要识别和卡证
        /// </summary>
        public int OcrType
        {
            get
            {

                return Utility.IntParse(this.Config["OcrType"], 0);
            }
            set
            {
                this.Config.Put("OcrType", value);
            }
        }

        /// <summary>
        /// 获得身份证肖像,身份证识别有效
        /// </summary>
        public bool CropPortrait
        {
            get
            {
                return this.Config.ContainsKey("CropPortrait");
            }
            set
            {
                if (value)
                {
                    this.Config.Put("CropPortrait", true);
                }
                else
                {

                    this.Config.Remove("CropPortrait");
                }
            }
        }

        /// <summary>
        /// 剪切身份证,身份证识别有效
        /// </summary>
        public bool CropIdCard
        {
            get
            {
                return this.Config.ContainsKey("CropIdCard");
            }
            set
            {
                if (value)
                {
                    this.Config.Put("CropIdCard", true);
                }
                else
                {

                    this.Config.Remove("CropIdCard");
                }
            }
        }
        /// <summary>
        /// 剪切银行卡
        /// </summary>
        public bool BorderCutImage
        {
            get
            {
                return this.Config.ContainsKey("BorderCutImage");
            }
            set
            {
                if (value)
                {
                    this.Config.Put("BorderCutImage", true);
                }
                else
                {

                    this.Config.Remove("BorderCutImage");
                }
            }
        }

        /// <summary>
        /// 横屏识别
        /// </summary>
        public bool IsLandscape
        {
            get
            {
                return this.Config.ContainsKey("IsLandscape");
            }
            set
            {
                if (value)
                {
                    this.Config.Put("IsLandscape", true);
                }
                else
                {

                    this.Config.Remove("IsLandscape");
                }
            }
        }

        /// <summary>
        /// 手动识别
        /// </summary>
        public bool IsManual
        {

            get
            {
                return this.Config.ContainsKey("IsManual");
            }
            set
            {
                if (value)
                {
                    this.Config.Put("IsManual", true);
                }
                else
                {

                    this.Config.Remove("IsManual");
                }
            }
        }

    }
}
